﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Work4
{
    public class Monkey
    {
        private int age;

        public int Age          // 用类型封装，保证变量的严整性
        {
            get
            {
                return age;
            }
            set
            {
                if (value> 0 && value < 80)
                {
                    age = value;
                }
                else
                {
                    age = 0;
                }
            }
        }
    }
}
